package com.chuangke.attachment.service;

import org.springframework.web.multipart.MultipartFile;

import com.chuangke.file.model.FileInfo;
import com.chuangke.system.entity.SysRelation;

public interface AttachmentService {
	
	
	/**
	 * 加载附件的文件元信息
	 * @param attachmentId
	 * @return
	 */
	FileInfo findAttachmentMeta(String attachmentId) ;
	
	/**
	 * 删除附件的文件元信息
	 * @param attachmentId
	 * @return
	 */
	void deleteAttachmentMeta(String attachmentId) ;
	
	/**
	 * 上传附件
	 * 
	 * @param bisId 业务id
	 * @param file  附件
	 * @return
	 */
	FileInfo uploadAchievement(String bisId, MultipartFile file);
	
	/**
	 * 上传附件
	 * @param relation
	 * @param file
	 * @return
	 */
	FileInfo uploadAchievement(SysRelation relation, MultipartFile file);

	/**
	 * 附件预览
	 * 
	 * @param attachmentId 附件文件id
	 * @return
	 */
	byte[] previewThum(String attachmentId);

	/**
	 * 附件下载
	 * @param attachmentId
	 * @return
	 */
	byte[] download(String attachmentId);

	/**
	 * 附件删除
	 * @param bisId
	 * @param attachmentId
	 */
	void delete(String bisId, String attachmentId);

	FileInfo uploadSysAchievement(String id, MultipartFile file);
}
